{strip}
<!DOCTYPE HTML>
<html lang="hu">
<head>
	<meta charset="UTF-8">
	<title>{$page_title}</title>
	
	{include file="inc_css.tpl"}
</head>
<body>
	<h1><a href="/adm">Mit nézel?</a></h1>
	<ul id="TOC"></ul>
	{if $smarty.request.value1 == 'svn'}
	<div class="box">
		<h2>SVN</h2>
		{if $svnout}
			<pre>
			{$svnout}
			</pre>
		{/if}
	</div>
	{elseif $smarty.request.value1 == 'db'}
	<div class="box">
		<h2>Frissítés TheTVDB-ről</h2>
		{if $dbout and $dbout|strlen}
			<pre>
			{$dbout}
			</pre>
		{else}
			<span class="green">Nincs frissítés.</span>
		{/if}
	</div>
	{elseif $smarty.request.value1 == 'updateseria'}
	<div class="box">
		<h2>Sorozatok</h2>
		{if $dbout and $dbout|strlen}
			<pre>
			{$dbout}
			</pre>
		{else}
			<span class="green">Nincs frissítés.</span>
		{/if}
	</div>
	{elseif $smarty.request.value1 == 'edituser'}
	{include file='adm_edituser.tpl'}
	{else}
	<div class="box">
		<h2>Beállítások</h2>
		<form method="post" action="/adm/">
			<input type="hidden" name="form-name" value="settings" />
			<input type="hidden" name="settings[external_caching]" value="0" />
			<input type="hidden" name="settings[integrate_facebook]" value="0" />
			<table>
				<tr>
					<th>Cachelés</th>
					<td>
						<label class="iobtn"><span></span><input type="checkbox" name="settings[external_caching]" value="1"{if $settings.external_caching}checked="checked"{/if} /></label>
					</td>
				</tr>
				<tr>
					<th>Facebook integrálás</th>
					<td>
						<label class="iobtn"><span></span><input type="checkbox" name="settings[integrate_facebook]" value="1"{if $settings.integrate_facebook}checked="checked"{/if} /></label>
					</td>
				</tr>
				<tr>
					<th>Host</th>
					<td>
						<input type="text" name="settings[host]" value="{$settings.host}" size="25" />				
					</td>
				</tr>
				<tr>
					<th>Leírás</th>
					<td>
						<input type="text" name="settings[description]" value="{$settings.description}" size="50" />				
					</td>
				</tr>
				<tr>
					<th>Kulcsszavak</th>
					<td>
						<input type="text" name="settings[keywords]" value="{$settings.keywords}" size="50" />
					</td>
				</tr>
				<tr>
					<th>Google Analytics</th>
					<td>
						<input type="text" name="settings[ga_code]" value="{$settings.ga_code}" />
					</td>
				</tr>
				<tr>
					<th>Lábléc</th>
					<td>
						<textarea name="settings[footer]" rows="10" cols="100">{$settings.footer|htmlentities}</textarea>
					</td>
				</tr>
			</table>
			<p>
				<input type="submit" value="Mentés"/>
			</p>
		</form>
		<br><a href="/adm/emptycache">Cache ürítése</a>
	</div>
	<div class="box">
		<h2>SVN</h2>
		<a href="/adm/svn" class="button">Frissítés keresése</a><br><br>
		r{$settings.version} ({$settings.date|date_format:'%Y.%m.%d %R'})
		{if $settings.version lt $latestversion.version}
			<br><span class="red"><strong>Újabb verzió érhető el:</strong> r{$latestversion.version} ({$latestversion.date|date_format:'%Y.%m.%d %R'})</span>
		{else}
			<br><span class="green"><strong>Nem érhető el frissítés, ez a legfrissebb verzió.</strong></span>
		{/if}
	</div>
	
	<div class="box">
		<h2>Frissítés TheTVDB-ről</h2>
		<a href="/adm/db" class="button">Adatbázis frissítése</a><br><br>
		Utoljára frissítve: {$settings.previoustime|date_format:'%Y.%m.%d %R'}
	</div>
	
	<div class="box">
		<h2>Felhasználók kezelése</h2>
		Regisztrált felhasználók: {$users|@count}
		<table>
			<thead>
				<tr>
					<th>E-mail/Név</th>
					<th>Regisztráció ideje</th>
					<th>Köv.</th>
					<th>Vél.</th>
					<th>Ért.</th>
					<th>Műveletek</th>
				</tr>
			</thead>
			<tbody>
				{section loop=$users name='u'}
					<tr>
						<th>
							<a href="/adm/edituser/{$users[u].id}">
								{if $users[u].user_settings.fb}{$users[u].user_settings.fb.last_name} {$users[u].user_settings.fb.first_name}{else}{$users[u].user_email|truncate:25:'...':true:true}{/if}
							</a>
						</th>
						<td>{$users[u].user_registration|date_format:'%Y.%m.%d %R'}</td>
						<td>{$users[u].follows}</td>
						<td>{$users[u].reviews}</td>
						<td>{$users[u].ratings}</td>
						<td>
							<a href="/adm/edituser/{$users[u].id}" class="icon edit" title="Szerkeszt">&#x270E;</a>
							{if $users[u].user_uuid}&nbsp;
							<a href="/adm/deluser/{$users[u].id}" class="icon del" title="Töröl">&#x2421;</a>
							{/if}
						</td>
					</tr>
				{/section}
			</tbody>
		</table>
	</div>
	<div class="box">
		<h2>Sorozatok</h2>
		<h3>Találatok: {$series|@count}</h3>
		<ul class="pagi-box">
		{section loop=$abc name='a'}
		<li><a href="/adm/spagi/{$abc[a]|strtoupper|urlencode}#sorozatok"{if $spagisel == $abc[a]|strtoupper} class="selected"{/if}>{$abc[a]|strtoupper}</a></li>
		{/section}
		</ul>
		<table>
			<thead>
				<tr>
					<th>Cím</th>
					<th>Először adásban</th>
					<th>Évadok</th>
					<th>Helyzet</th>
					<th>Frissítve</th>
					<th>Műveletek</th>
				</tr>
			</thead>
			<tbody>
				{section loop=$series name='e'}
				<tr>
					<th>{$series[e].seriesname}</th>
					<td>{if $series[e].firstaired != '0000-00-00'}{$series[e].firstaired|date_format:'%Y.%m.%d.'}{else}-{/if}</td>
					<td>{$series[e].seasons|default:'0'}</td>
					<td>{$series[e].status|default:'-'}</td>
					<td>{$series[e].last_updated|date_format:'%Y.%m.%d.'}</td>
					<td>
						<a href="/adm/updateseria/{$series[e].id}" class="icon update" title="Frissít">U</a>&nbsp;
						<a href="/adm/editseria/{$series[e].id}" class="icon edit" title="Szerkeszt">&#x270E;</a>&nbsp;
						<a href="/adm/delseria/{$series[e].id}" class="icon del" title="Töröl">&#x2421;</a>&nbsp;
					</td>
				</tr>
				{sectionelse}
				<tr>
					<th colspan="5">Nincsenek sorozatok</th>
				</tr>
				{/section}
			</tbody>
		</table>
	</div>
	
	{/if}
	{include file="inc_js.tpl"}
</body>
</html>
{/strip}